package com.cloud.feign.test.service.impl;

import com.cloud.feign.test.client.HelloClient;
import com.cloud.feign.test.client.UserClient;
import com.cloud.feign.test.service.FeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FeignServiceImpl implements FeignService {
    @Autowired
    private HelloClient helloClient;
    @Autowired
    private UserClient userClient;
    @Override
    public void testFeignThread() {
        //当使用到了 Hystrix 线程隔离机制时,注意ThreadLocal传值和线程池可见性
        //Fallback的当前线程不同
        helloClient.feignThreadTest();
        helloClient.feignThreadTest2();//
        userClient.user();//
    }
}
